package com.lw.json.pojo;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

/**
 * @Description:
 * @ClassName: Student
 * @Author: lanwei
 * @Date: 2022/12/13 16:24
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class Student {

    //自定义字段的输出顺序
    @JSONField(ordinal = 1)
    private Integer id;

    /**
     * ordinal：表示为输出顺序
     * name：表示为json传字段值
     * serialize：表示为不参与序列化
     */
    @JSONField(ordinal = 2 , name = "username")
    private String name;

    @JSONField(ordinal = 3)
    private Integer age;

    @JSONField(ordinal = 4)
    private Integer sex;

    @JSONField(serialize = false)
    private String address;
}
